home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 5588 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.0 KB

  1. Path: hilbert.dnai.com!usenet
  2. From: Victor Bazarov <vbazarov@imsisoft.com>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: for loop question
  5. Date: Mon, 05 Feb 1996 12:07:15 -0800
  6. Organization: IMSI
  7. Message-ID: <31166373.28DA@imsisoft.com>
  8. References: <4emqf8$470@opal.southwind.net> <4f1kud$9rk@newsbf02.news.aol.com>
  9. NNTP-Posting-Host: 204.182.61.84
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0b6a (Win95; I)
  14.  
  15. recursion@aol.com (Recursion) wrote:
  16. > The loop is never entered when you set the value equal to 0.  You have
  17. > specifed the loop check value to be performed while equal to 10 by using
  18. > the ==.  The program works when the value is less than 10.  If you were to
  19. > set use
  20. > int i;
  21. > for (i=10;i==10;i++) the program would enter the loop only one time and
  22. > would print out your data.
  23. > int i;
  24. > for(i=0;i--10;i++) will never execute because i will never equal 10.  ^^^^^^^^^^^^^^^^^^^^ Supposedly this is a type-o and must be
  25.  
  26. for(i=0;i==10;i++)
  27.  
  28. Sorry for attention,
  29. Victor.
  30.